#include<bits/stdc++.h>
using namespace std;
int d[1005][1005], n, m;
int main(){
	cin >> n >> m;
	while (m--) {
		int x1, y1, x2, y2;
		cin >> x1 >> y1 >> x2 >> y2;
		d[x1][y1]++;
		d[x1][y2 + 1]--;
		d[x2 + 1][y1]--;
		d[x2 + 1][y2 + 1]++;
	}
	for (int i = 1; i <= n; i++){
		for (int j = 1; j <= n; j++){
			d[i][j] = d[i][j - 1] + d[i - 1][j] - d[i - 1][j - 1] + d[i][j];
			cout << d[i][j] << " ";
		}
		cout << endl;
	}
	return 0;
}
